package yadong.example.code;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        String neighborhoodString = "Maryland,Virginia,NW Washington,Downtown,Baltimore,Bethesda,Dupont Circle,Washington,Georgetown,Old Town Alexandria,U Street/Cardozo,Chinatown,Rockville,Silver Spring,Arlington,Alexandria (Other),NE Washington,Annapolis,Capitol Hill,Reston-Herndon,Foggy Bottom,Montgomery County,Frederick County,Falls Church,Prince George's County,The Mall,Vienna,Fairfax County,Fairfax City,Gaithersburg,Adams Morgan,College Park,Columbia,Sterling/Ashburn,Loudoun County,Leesburg,Manassas,Columbia Heights,Logan Circle,Cleveland Park,Chantilly/Centreville,Woodbridge,Friendship Heights/Chevy Chase,Bowie,Crystal City/Pentagon City,McLean,SE Washington,Clarendon,Hyattsville/Riverdale,Laurel,Anne Arundel County,Wheaton,Franconia/Springfield,Tysons Corner,Annandale,Oxon Hill/Fort Washington,Tenleytown/AU Park,Ballston,Anacostia,Takoma Park/Takoma,SW Washington,Ellicott City,Fauquier County,Upper Marlboro,Brookland,Prince William County,Rosslyn,Calvert County,Howard County,St. Mary's County,Courthouse,Shirlington,Charles County,Del Ray,Arlington/Wilson Blvd.,Southwest Waterfront,Pennsylvania,West Virginia,Delaware,Mount Rainier,Penn Quarter,14th Street,Mount Pleasant,Shaw,Eastern Market/Barracks Row,NoMa,Bailey's Crossroads,Bloomingdale,Cleveland Park/Woodley Park,Glover Park,Merrifield,National Harbor,Palisades,Woodley Park";
        String dc_loc = "U Street,The Mall,Tenleytown,Takoma ,SW Waterfront,Other Southwest,Other Southeast,Other Northwest,Other Northeast,Logan Circle,Georgetown,Foggy Bottom,Dupont Circle,Downtown,Columbia Heights/Mt. Pleasant,Cleveland Park/Woodley Park ,Chinatown ,Chevy Chase ,Capitol Hill ,Brookland ,Anacostia ,Adams Morgan";
        String md_loc = "St. Mary's County ,Prince George's County ,Montgomery County,Howard County ,Greater Maryland ,Frederick County ,Charles County ,Calvert County ,Baltimore ,Anne Arundel County";
        String va_loc = "Prince William County ,Loudoun County ,Greater Virginia ,Fauquier County ,Fairfax County ,Arlington County ,Alexandria";
       
        String dc2 = ",14th Street,Adams Morgan,Anacostia,Bloomingdale,Brookland,Capitol Hill,Chinatown,Cleveland Park,Cleveland Park/Woodley Park,Columbia,Columbia Heights,Downtown,Dupont Circle,Eastern Market/Barracks Row,Foggy Bottom,Georgetown,Glover Park,Logan Circle,Mount Pleasant,NE Washington,NW Washington,NoMa,Palisades,Penn Quarter,Pennsylvania,SE Washington,SW Washington,Shaw,Southwest Waterfront,The Mall,U Street/Cardozo,Woodley Park";
        String md2 = ",Annapolis,Anne Arundel County,Baltimore,Bethesda,Bowie,Calvert County,Charles County,College Park,Delaware,Ellicott City,Frederick County,Friendship Heights/Chevy Chase,Gaithersburg,Howard County,Hyattsville/Riverdale,Laurel,Montgomery County,Mount Rainier,Oxon Hill/Fort Washington,Rockville,National Harbor,Silver Spring,St. Mary's County,Takoma Park/Takoma,Tenleytown/AU Park,Upper Marlboro,Prince George's County,Wheaton,";
        String va2 = ",Merrifield,Loudoun County,Leesburg,Franconia/Springfield,Fauquier County,Del Ray,Chantilly/Centreville,Bailey's Crossroads,Annandale,Alexandria,Arlington,Arlington/Wilson Blvd.,Ballston,,Clarendon,Courthouse,Crystal City/Pentagon City,Fairfax City,Fairfax County,Falls Church,Manassas,McLean,Old Town Alexandria,Reston-Herndon,Rosslyn,Shirlington,Sterling/Ashburn,Tysons Corner,Vienna,Prince William County,Woodbridge";
        
        dc_loc+=dc2;
        md_loc+=md2;
        va_loc+=va2;
        
        
        List<String> nl = Arrays.asList(neighborhoodString.split("\\s*,\\s*"));
        List<String> dc = Arrays.asList(dc_loc.split("\\s*,\\s*"));
        List<String> md = Arrays.asList(md_loc.split("\\s*,\\s*"));
        List<String> va = Arrays.asList(va_loc.split("\\s*,\\s*"));
        Collections.sort(nl);
        Collections.sort(dc);
        Collections.sort(md);
        Collections.sort(va);
        for (String n : nl) {
			try {
				System.out.println("<option value=\"locations_"+URLEncoder.encode(n,"UTF-8")+"\">"+n+"</option>");
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}
        System.out.println("=============================================");
        for (String n : dc) {
        	System.out.println("<option value=\"D.C._"+n+"\"  class=\"indent\">"+n+"</option>");
        }
        System.out.println("=============================================");
        for (String n : md) {
        	System.out.println("<option value=\"Maryland_"+n+"\"  class=\"indent\">"+n+"</option>");
        }
        System.out.println("=============================================");
        for (String n : va) {
        	System.out.println("<option value=\"Virginia_"+n+"\"  class=\"indent\">"+n+"</option>");
        }
        System.out.println("=============================================");
        for (String n : nl) {
        	System.out.println(n);
        }
    }
}
